package com.boot.phoenix.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.boot.phoenix.dao.TestMapper;
import com.boot.phoenix.entity.Test;
import com.boot.phoenix.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TestServiceImpl implements TestService {

    @Autowired
    private TestMapper testMapper;

    @Override
    public List<Test> seletcs() {
        List<Test> queryList = testMapper.selects();
        return queryList;
    }

    @Override
    public IPage<Test> page(Integer page, Integer size) {
        IPage<Test> ipage = new Page<>(page, size);
        return testMapper.page(ipage);
    }

    @Override
    public void save(Test test) {
        testMapper.upsert(test);
    }
}
